function f = broy_trid(x)
% Broyden Tridiagonal Function   
%x0=[-1., -1., ..., -1.]...  
%fmin=n/2,m=20
%Author:shi yangyang
n=length(x);
temp(1)=3.0*x(1)-2.0*x(1)*x(1);
for i=2:n-1
    temp(i)=3.0*x(i)-2.0*x(i)*x(i)-x(i-1)-2.0*x(i+1)+1.0;
end
temp(n)=3.0*x(n)-2.0*x(n)*x(n)-x(n-1)+1.0;
f=sum(temp.^2);
f;